﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using COM.Rights.Model;
using COM.Rights.BLL;
using System.Data;

public partial class Pages_BdOrder_Default : ZMPageList<BdOrder,BdOrderInfo>
{  
	#region 重写方法


    protected override void  OnLoad()
    {
 	     base.OnLoad();
    }

    protected override void OnBind()
    {
        base.OnBind();

        PermUserWeb _PermUserWeb = new PermUserWeb();
        List<DBParameter> _listDBParameter = new List<DBParameter>();
        _listDBParameter.Add(new DBParameter("@TranType", "hostname"));
        _listDBParameter.Add(new DBParameter("@UID", ZASession.Account));

        IDataReader sdr = _PermUserWeb.ExecuteReader("[dbo].[mdlist_sel]", _listDBParameter, System.Data.CommandType.StoredProcedure);
        DataTable dt = new DataTable();
        dt.Load(sdr);

        ZABinder.FillList(string.Empty, ddlHostName, true, dt);
    }



    protected override string DefaultSortField
    {
        get
        {
            return "OrderDate Desc,Receiver";
        }
    }

    protected override void ToolBarSearchClick(object sender, ImageClickEventArgs e)
    {
        base.ToolBarSearchClick(sender, e);
    }

    //不显示保存按纽
    protected override void InitBtnSave()
    {
        //base.InitBtnSave();
    }

    protected override int  PageSize
    {
	    get 
	    { 
		     //return base.PageSize;
            return StringHelper.FormatBlankStringToint(txtPageSize.Text);
	    }
    }
    protected override void ToolBarDeleteClick(object sender, ImageClickEventArgs e)
    {

        BdOperateLog bol = new BdOperateLog();
        BdOperateLogInfo model = new BdOperateLogInfo();
        model.MenuName = this.Title;
        model.OperateBy = ZASession.Account;
        model.OperateDate = DateTime.Now;
        
        base.ToolBarDeleteClick(sender, e);
    }

    protected override void OnMainGridRowDeleting(System.Web.UI.WebControls.GridViewDeleteEventArgs e)
    {
        base.OnMainGridRowDeleting(e);
    }

    protected override string DefaultFilter
    {
        get
        {
            return string.Format("IsDelete = 0 AND  hostname IN ( SELECT hostname FROM permUserWeb puw(NOLOCK) WHERE puw.UID = '{0}' )", ZASession.Account);
            //return string.Format(" EXISTS( SELECT 1 FROM permUserWeb puw WHERE 1=1)");
        }
    }


	#endregion 	重写方法
}